Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] - Terrenetes Download #1589

Merged
merged 1 commit into from
Jan 16, 2025
Merged

[FIX] - Terrenetes Download #1589

merged 1 commit into from
Jan 16, 2025

Conversation

gambol99
Copy link
Member

@gambol99 gambol99 commented Jan 16, 2025

Attempting to fix up the issue related to artifactory download in the tnctl create revision command,

We had a bug in the code which was cause issues with direct http calls.

-       if strings.HasPrefix(source, "http") {
-               source = strings.TrimPrefix(source, "http://")
-               source = strings.TrimPrefix(source, "https://")

This has been removed.

The main issue however was found when dealing with Artifactory assets, using the follow example.

bin/tnctl create revision https://USERNAME:[email protected]/artifactory/art-terraform-modules-local/kash/rds/aws/1.0.0 -f test.yaml

We are getting a 404. Adding a .zip to the URL i.e. /kash/rds/aws/1.0.0.zip allowed us to download the zip file. I’m guessing we are missing a headers information which artifactory requires.

The second issue comes from the fact that zip is downloaded, BUT extracted into a subfolder in the destination directory - i’ve confirmed the same bahavior when using go-getter binary directory

ls /tmp/test-download
 .   ..   terraform-aws-rds

In the URL for the revision we fix this by adding the submodule path i.e.

bin/tnctl create revision https://USERNAME:[email protected]/artifactory/art-terraform-modules-local/kash/rds/aws/1.0.0.zip//terraform-aws-rds -f test.yaml

I’m guessing terraform most be doing something outside of the go-getter li to fix this.

Attempting to fix up the issue related to artifactory download in the tnctl create revision command
@gambol99 gambol99 requested a review from KashifSaadat January 16, 2025 07:23
@gambol99 gambol99 merged commit 1e86ef8 into master Jan 16, 2025
11 checks passed
@gambol99 gambol99 deleted the fix_download branch January 16, 2025 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants